# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=timed
pkgver=3.6.6
pkgrel=0
pkgdesc="The time daemon manages system time, timezone and settings, executing actions at given time and managing the event queue"
url="https://git.sailfishos.org/mer-core/profiled"
arch="all"
license="LGPL-2.1-only"
depends_dev="libiodata-dev elogind-dev sailfish-access-control"
makedepends="$depends_dev qt5-qtbase-dev"
subpackages="$pkgname-dev"
source="https://git.sailfishos.org/mer-core/timed/-/archive/$pkgver/timed-$pkgver.tar.gz
	0001-Fixes-build.patch
	"

prepare() {
	default_prepare

	# The build system refers to qmacro.h in a different location
	# Taken from upstream RPM packaging
	mkdir -p src/h/timed-qt5
	ln -f src/lib/qmacro.h src/h/timed-qt5/qmacro.h
}

build() {
	qmake-qt5 -recursive
	make
}

package() {
	INSTALL_ROOT="$pkgdir" make install

	# Remove installed tests
	rm -r "$pkgdir"/opt
}

sha512sums="d6d9c7cd27084c10a2da8afa1985041e41d093875e54c22d1b2dbe210309387e6773645a8e827b335dd215e96f4e34013017bacfbb05828d08e2cfdbcf124cfb  timed-3.6.6.tar.gz
a53958ea2a3b8cd2f0ffa9e1b53b90657a8e638878292fe294d1745c31ee7c8b159010723ceea9164450453dbb208adfd58f97578adf750292df86b8c3c4a772  0001-Fixes-build.patch"
